package com.xlh.param.course;

import com.xlh.util.InputValidator;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

/**
 * 创建或修改课程分类参数
 * <p>
 * Created by lx on 2019/10/28.
 */
@Data
public class CreateOrUpdateCourseSortParam {

    @ApiModelProperty(value = "课程分类id")
    private Long id;

    @ApiModelProperty(value = "课程分类名称")
    @NotBlank(message = "课程分类名称不能为空")
    @Length(max = 20, message = "课程分类名称不能超过20个字符")
    private String name;

    public String getName() {
        return name == null ? null : InputValidator.regSpecialChar(name);
    }

}
